import React from 'react'
import Taro from '@tarojs/taro'
import { AtListItem,AtDivider,AtAvatar  } from "taro-ui"
import { View } from '@tarojs/components'
import "./HospitalItem.scss"

class HospitalItem extends React.Component{

  handleClick = () => {
    const page = '/pages/pagesA/selectDeptByHosp/selectDeptByHosp?name='+this.props.name+'&address='+this.props.address+'&hospital_id='+this.props.hospital_id+'&picture='+this.props.picture
    Taro.navigateTo({url: page})
  }

  render(){
      return(
        <View>
          <View className='hospital'>
            <AtAvatar image={this.props.picture}  className='hospital_image'></AtAvatar>
            <AtListItem className='name' note={this.props.address}
                hasBorder={false} title={this.props.name} onClick={this.handleClick}/>
          </View>
          <AtDivider lineColor='#f2f2f2' height='35' /> 
        </View>
      )
    }
}
  
export {HospitalItem}